package models

import "encoding/xml"

type CDATA struct {
	Text string `xml:",cdata"`
}

type BonusLingQian struct {
	XMLName    xml.Name `xml:"xml"`
	Appid      CDATA    `xml:"mch_appid"`
	Mch_id     CDATA    `xml:"mchid"`
	Nonce_str  CDATA    `xml:"nonce_str"`
	Mch_billno CDATA    `xml:"partner_trade_no"`
	Openid     CDATA    `xml:"openid"`
	CheckName  CDATA    `xml:"check_name"`
	Amount     CDATA    `xml:"amount"`
	Desc       CDATA    `xml:"desc"`
	Sign       CDATA    `xml:"sign"`
}

type Bonus struct {
	XMLName      xml.Name `xml:"xml"`
	Act_name     CDATA    `xml:"act_name"`
	Client_ip    CDATA    `xml:"client_ip"`
	Mch_billno   CDATA    `xml:"mch_billno"`
	Mch_id       CDATA    `xml:"mch_id"`
	Nonce_str    CDATA    `xml:"nonce_str"`
	Re_openid    CDATA    `xml:"re_openid"`
	Remark       CDATA    `xml:"remark"`
	Send_name    CDATA    `xml:"send_name"`
	Total_amount CDATA    `xml:"total_amount"`
	Total_num    CDATA    `xml:"total_num"`
	Wishing      CDATA    `xml:"wishing"`
	Wxappid      CDATA    `xml:"wxappid"`
	Sign         CDATA    `xml:"sign"`
}

//付款订单结果
type WithdrawResult struct {
	XMLName    xml.Name `xml:"xml"`
	ReturnCode string   `xml:"return_code"`
	ReturnMsg  string   `xml:"return_msg"`
	ResultCode string   `xml:"result_code"`
	ErrorCode  string   `xml:"err_code"`
	ErrCodeDes string   `xml:"err_code_des"`
}

// 请求ACCESS_TOKEN 返回
type RequstAccessToken struct {
	ErrorCode   int    `json:"errcode"`
	ErrorMsg    string `json:"errmsg"`
	AccessToken string `json:"access_token"`
	ExpiresIn   int    `json:"expires_in"`
}

/*
	{
	  "access_token": "ACCESS_TOKEN",
	  "expires_in": 7200,
	  "refresh_token": "REFRESH_TOKEN",
	  "openid": "OPENID",
	  "scope": "SCOPE"
	}
*/

// 请求Code2Session返回
type RequstCode2Session struct {
	AccessToken 	string `json:"access_token"`
	ExpiresIn   	int    `json:"expires_in"`
	Openid     		string `json:"openid"`
	RefreshToken 	string `json:"refresh_token"`
	Scope 			string `json:"scope"`
	ErrorCode  		int    `json:"errcode"`
	ErrorMsg   		string `json:"errmsg"`
}

/*
{
  "openid": "OPENID",
  "nickname": "NICKNAME",
  "sex": 1,
  "province": "PROVINCE",
  "city": "CITY",
  "country": "COUNTRY",
  "headimgurl": "http://wx.qlogo.cn/mmopen/g3MonUZtNHkdmzicIlibx6iaFqAc56vxLSUfpb6n5WKSYVY0ChQKkiaJSgQ1dZuTOgvLLrhJbERQQ4eMsv84eavHiaiceqxibJxCfHe/0",
  "privilege": ["PRIVILEGE1", "PRIVILEGE2"],
  "unionid": " o6_bmasdasdsad6_2sgVt7hMZOPfL"
}
*/
// 请求返回
type RequestWXUserInfo struct {
	Openid     		string  `json:"openid"`
	NickName		string	`json:"nickname"`
	Sex 			int     `json:"sex"`
	Province        string  `json:"province"`
	City            string  `json:"city"`
	Country         string  `json:"country"`
	HeadImgUrl      string  `json:"headimgurl"`
	Privilege       []string  `json:"privilege"`
	UnionId         string  `json:"unionid"`
	ErrorCode  		int     `json:"errcode"`
	ErrorMsg   		string  `json:"errmsg"`
}


